<?php
namespace User\Controller;
//意见反馈
use Common\Controller\MemberbaseController;

class FeedbackController extends MemberbaseController {

    public function _initialize() {
        parent::_initialize();
        $this->feedback_model = M('feedback');
    }

    public function index(){
        $this->display();
    }

    public function add_post(){
        $data['feedback_content'] = I('put.')['feedBack'];
        $data['create_member'] = I('put.')['userName'];
        $data['create_time'] = get_admin_time();
        $id = $this->feedback_model->add($data);
        if ($id > 0){
            $success = '{
                "success":"true",
                "code":"200",	
                 "message":"ok",
                "data": ""
             }';
        }else{
            $success = '{
                "success":"false",
                "code":"400",	
                 "message":"no",
                "data": ""
             }';
        }

        $this->ajaxReturn(json_decode($success,1));
    }

}


